package com.ruoyi.car.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.CarInspectionMapper;
import com.ruoyi.car.domain.CarInspection;
import com.ruoyi.car.service.ICarInspectionService;

/**
 * 年检Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-03
 */
@Service
public class CarInspectionServiceImpl implements ICarInspectionService 
{
    @Autowired
    private CarInspectionMapper carInspectionMapper;

    /**
     * 查询年检
     * 
     * @param inspectionId 年检主键
     * @return 年检
     */
    @Override
    public CarInspection selectCarInspectionByInspectionId(Long inspectionId)
    {
        return carInspectionMapper.selectCarInspectionByInspectionId(inspectionId);
    }

    /**
     * 查询年检列表
     * 
     * @param carInspection 年检
     * @return 年检
     */
    @Override
    public List<CarInspection> selectCarInspectionList(CarInspection carInspection)
    {
        return carInspectionMapper.selectCarInspectionList(carInspection);
    }

    /**
     * 新增年检
     * 
     * @param carInspection 年检
     * @return 结果
     */
    @Override
    public int insertCarInspection(CarInspection carInspection)
    {
        carInspection.setCreateTime(DateUtils.getNowDate());
        return carInspectionMapper.insertCarInspection(carInspection);
    }

    /**
     * 修改年检
     * 
     * @param carInspection 年检
     * @return 结果
     */
    @Override
    public int updateCarInspection(CarInspection carInspection)
    {
        carInspection.setUpdateTime(DateUtils.getNowDate());
        return carInspectionMapper.updateCarInspection(carInspection);
    }

    /**
     * 批量删除年检
     * 
     * @param inspectionIds 需要删除的年检主键
     * @return 结果
     */
    @Override
    public int deleteCarInspectionByInspectionIds(Long[] inspectionIds)
    {
        return carInspectionMapper.deleteCarInspectionByInspectionIds(inspectionIds);
    }

    /**
     * 删除年检信息
     * 
     * @param inspectionId 年检主键
     * @return 结果
     */
    @Override
    public int deleteCarInspectionByInspectionId(Long inspectionId)
    {
        return carInspectionMapper.deleteCarInspectionByInspectionId(inspectionId);
    }
}
